prepare("select * from pinassociate where PINCODE =:p") ; $sql1->bindparam(':p', $pin) ; $sql1->execute() ; $rc = $sql1->rowcount() ; if($rc > 0) { $row1 = $sql1->FETCH(PDO::FETCH_ASSOC) ; $pin = $row1['PINCODE'] ; $owner = $row1['REGNO'] ; $numbused = $row1['NOUSED'] ; $tm = $row1['TERM'] ; $yr = $row1['acadsession'] ; //check reg no //if($numbused >= 4) $msg[] = 'You have used this Pin above its Limit please buy another Card' ; //if($term != $tm) $msg[] = 'You have used this Pin to Check another Term Result, Please Get another Card' ; if($yr != $schyear) $msg[] = 'You have used this Pin to Check another Session Result, Please Get another Card' ; }// end if access, i.e, if pin exist //statrt checking result if pins are valid if(empty($msg)) { //check if the student result is ready. if($term=="THIRD TERM") { $sqlc = $DBcon->prepare(" select * from marks where (stregno =:rg and acad_session =:yr) and (stclass = :cs and term =:tm)") ; $sqlc->bindparam(':rg', $regno) ; $sqlc->bindparam(':yr', $schyear) ; $sqlc->bindparam(':tm', $term) ; $sqlc->bindparam(':cs', $classid) ; $sqlc->execute() ; $rcx = $sqlc->rowcount() ; //$resultc = mysql_query($sqlc) or die('Error: ' . mysql_error()); if($rcx > 0) { $rowc = $sqlc->FETCH(PDO::FETCH_ASSOC) ; $resultnoc = $rowc['stregno'] ; $_SESSION["getresultcm"] = $resultnoc ; } else $msg[] = 'Sorry Your Result is not ready, check back next week' ; } else { $sqlc = $DBcon->prepare(" select * from marks where (stregno =:rg and acad_session =:yr) and (term =:tm and stclass = :cs)") ; $sqlc->bindparam(':rg', $regno) ; $sqlc->bindparam(':yr', $schyear) ; $sqlc->bindparam(':tm', $term) ; $sqlc->bindparam(':cs', $classid) ; $sqlc->execute() ; $rcx = $sqlc->rowcount() ; //$resultc = mysql_query($sqlc) or die('Error: ' . mysql_error()); if($rcx > 0) { $rowc = $sqlc->FETCH(PDO::FETCH_ASSOC) ; $resultnoc = $rowc['stregno'] ; $_SESSION["getresultc"] = $resultnoc ; } else $msg[] = 'Sorry, Your Result is not Ready or Make Sure you entered correct Information' ; } //begin card check if(empty($msg)) { if($_SESSION["term"]=='MOCK') { header("location: resultsheet/mock.php"); } else { if($_SESSION["term"]=='THIRD TERM') header("location: resultsheet/pjsheet.php"); else header("location: resultsheet/basicsheet.php"); } } } } ?>